/**
 * 
 */
package com.ms.game.offlineSpin.async;

import com.ms.game.offlineSpin.OfflineSpinResultData;
import com.xpec.c4.db.dao.PlayerDAO;
import com.xpec.c4.game.utility.GUID;
import com.xpec.c4.service.module.task.TaskAsyncCommand;

/**
 * @author TW15010
 *
 */
public class SaveOfflineSpinResultAsync extends TaskAsyncCommand {
	/**
	 * player guid
	 */
	private GUID playerId;

	/**
	 * 離線 spin 結果
	 */
	private OfflineSpinResultData result;

	@Override
	public void asyncExecute() throws Exception {
		if (playerId == null) {
			return;
		}

		if (result == null) {
			return;
		}

		PlayerDAO.saveOfflineSpinResult(playerId, result);
	}

	@Override
	public void execute() throws Exception {
	}

	public OfflineSpinResultData getResult() {
		return result;
	}

	public void setResult(OfflineSpinResultData result) {
		this.result = result;
	}

	public GUID getPlayerId() {
		return playerId;
	}

	public void setPlayerId(GUID playerId) {
		this.playerId = playerId;
	}
}
